const name = "Token";
export default {
    /**
     * 获取Token
     */
    getToken: () => useCookie(name).value,

    /**
     * 新增Token
     * @param token
     */
    setToken: (token: string) => {
        const setToken = useCookie(name, {
            path: "/",
            maxAge: 60 * 60 * 24 * 7
        });
        setToken.value = token;
    },

    /**
     * 删除Token
     */
    delToken: () => {
        useCookie(name).value = null;
    }
}